package com.qinggeng.framework.config.mq.impl;

import com.alibaba.fastjson.JSONObject;
import com.qinggeng.framework.config.mq.dto.MessageClassifyDTO;
import com.qinggeng.framework.config.mq.handle.MessageHandle;
import com.qinggeng.project.system.service.IGoodsPercentService;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class GoodsPercentageUpdateHandleImpl implements MessageHandle {
    @Autowired
    private IGoodsPercentService goodsPercentService;
    @Override
    public void handle(String msg) {
        log.info("商品提成处理{}",msg);
        MessageClassifyDTO classifyDTO= JSONObject.parseObject(msg,MessageClassifyDTO.class);
        goodsPercentService.updateGoodsPercentage(classifyDTO.getClassifyId());
    }
}
